import request from '@/utils/request'
/**
 * 创建视频解析
 * @param {*} data {"file_name": "","file_id": ""}
 * @returns
 */
export const httpCreateCourseAnalysis = (data) => {
  return request({
    url: '/course/create',
    method: 'post',
    data,
  })
}
/**
 * 删除视频解析
 * @param {*} data {"course_id": 1}
 * @returns
 */
export const httpDeleteCourseAnalysis = (data) => {
  return request({
    url: '/course/delete',
    method: 'post',
    data,
  })
}

/**
 * 查询视频列表
 * @param {*} params {keyword:'',page:1,limit:10}
 * @returns
 */
export const httpGetCourseList = (params) => {
  return request({
    url: '/course/query',
    method: 'get',
    params,
  })
}
/**
 * 视频详情
 * @param {*} params {id:1}
 * @returns
 */
export const httpGetVideoDetail = (params) => {
  return request({
    url: '/course/info',
    method: 'get',
    params,
  })
}
/**
 * 根据key获取对应内容
 * @param {*} params {task_id=''&file_key=''&id=1}
 * @returns
 */
export const httpGetContentByKey = (params) => {
  return request({
    url: '/course/key-info',
    method: 'get',
    params,
  })
}

/**
 * 标记、取消标记
 * @param {*} data {"id": 0,"paragraph_id": "","tag": ""}
 * @returns
 */
export const httpMarkText = (data) => {
  return request({
    url: '/course/update-tag',
    method: 'post',
    data,
  })
}
/**
 * 更新笔记内容
 * @param {*} data {"id": 0,"content": ""}
 * @returns
 */
export const httpUpdateNoteContent = (data) => {
  return request({
    url: '/course/update-notebook',
    method: 'post',
    data,
  })
}
/**
 * 加入个人笔记
 * @param {*} data {"folder_id": 0,"id": 0, "content": ""}
 * @returns
 */
export const httpAddNoteToMy = (data) => {
  return request({
    url: data.content ? 'course/add-mind-map' : '/course/add-user-note',
    method: 'post',
    data,
  })
}
